﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebStudio.Business.Entity;
using WebStudio.Business.Rule;

public partial class About : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.Title = Info.ArticalTitle + " - 莆田市闽中广告装饰有限公司";
        }
    }

    private int Id
    {
        get 
        {
            if (string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                return 0;
            }
            else
            {
                int id = 0;
                try
                {
                    id = Convert.ToInt32(Request.QueryString["id"]);
                }
                catch
                {
                    id = 0;
                }
                return id;
            }
        }
    }

    public ArticalEntity Info
    {
        get
        {
            return getBottom();
        }
    }

    private ArticalEntity getBottom()
    {
        ArticalEntity info = ArticalRule.GetArticalEntity("where ArticalId=" + Id + "");
        
        if (info != null)
        {
            return info;
        }
        else
        {
            Response.Redirect("~/Default.aspx");
            return new ArticalEntity();
        }
    }
    
}
